Developer Documentation
PATHJava Developer Documentation > Mac OS Runtime for Java > JManager > Programming With JManager


Runtime Invocation Functions

All JManager API calls reference an instantiation of the Java runtime environment called a session or a JMSessionRef object. This section describes routines that create and dispose of a Java runtime session.


JMOpenSession

Instantiates a Java runtime session and returns a session pointer.

OSStatus JMOpenSession (
                     JMSessionRef* session,
                     JMRuntimeOptions runtimeOptions,
                     JMVerifierOptions verifyMode,
                     const JMSessionCallbacks* callbacks,
                     JMTextEncoding desiredEncoding,
                     JMClientData data);
session
A pointer to a Java runtime session. On return, this parameter is the allocated session.
runtimeOptions
A pointer to a runtime options structure. See Runtime Session Options for more information.
verifyMode
A flag indicating whether to use the code verifier. See Session Security Indicators for a list of possible values.
callbacks
A pointer to a session callbacks structure. See Session Callbacks Structure for more information.
desiredEncoding
The text encoding to use for any text sent to the designated standard output or standard error.
data
Any optional client-specific data.
function result
A result code; see JManager Result Codes.

DISCUSSION

A valid session pointer has a value other than null . If not enough system memory exists to instantiate a session, JMOpenSession returns memFullErr .

SEE ALSO

Beginning a Java Runtime Session.

The JMCloseSession function.


JMCloseSession

Ends a Java runtime session and removes the allocated JMSessionRef object.

OSStatus JMCloseSession (JMSessionRef session);
session
The session to be removed.

DISCUSSION

A successful call to JMCloseSession also frees any resources allocated by JManager. However, any resources that you explicitly allocated on behalf of JManager (such as AWT contexts or applets) must be explicitly removed before calling JMCloseSession .

SEE ALSO

The JMOpenSession function.


JMIdle

Allows JManager time to service other threads.

OSStatus JMIdle     (JMSessionRef session,
                     UInt32 JMTimeMillis);
session
The current session.
JMTimeMillis
The amount of time, in milliseconds, allowed to service other threads. For the default wait period, you can set this parameter to kDefaultJMTime .
function result
A result code; see JManager Result Codes.

DISCUSSION

If no threads need to be serviced, JMIdle returns immediately. JMIdle also returns, suspending other threads, if a user event occurs in the current session. You should call the JMIdle function once each time through the event loop.

SEE ALSO

Servicing Other Threads.

The JMFrameMouseOver function.


JMGetProxyInfo

Gets the proxy information for a given session.

OSStatus JMGetProxyInfo (
                     JMSessionRef session,
                     JMProxyType type,
                     JMProxyInfo* proxyInfo);
session
The session whose proxy information you wish to determine.
type
The type of proxy you want to query. See Session Security Indicators for a list of possible values to pass.
proxyInfo
A pointer to a proxy information structure. on return, this structure contains the proxy information for the specified proxy type. For more information, see Proxy Server Options.
function result
A result code; see JManager Result Codes.

SEE ALSO

The JMSetProxyInfo function
.

Specifying Proxy Servers
.

JMSetProxyInfo

Sets the proxy information for an existing session.

OSStatus JMSetProxyInfo (
                     JMSessionRef session,
                     JMProxyType type,
                     const JMProxyInfo* proxyInfo);
session
The session whose proxy information you wish to set.
type
The type of proxy you want to query. See Session Security Indicators for a list of possible values to pass.
proxyInfo
A pointer to a proxy information structure containing the proxy information to set. For more information, see Proxy Server Options.
function result
A result code; see JManager Result Codes.

DISCUSSION

You may specify different proxy servers for HTTP, firewall, and FTP access.

SEE ALSO

The JMGetProxyInfo function

Specifying Proxy Servers.


JMGetVerifyMode

Gets the state of the code verifier for an existing session.

OSStatus JMGetVerifyMode (
                     JMSessionRef session,
                     JMVerifierOptions* verifierOptions);
session
The session whose code verifier mode you wish to set.
verifierOptions
A pointer to a code verifier option. on return, this parameter is the state of the code verifier. See Session Security Indicators for a list of possible values.
function result
A result code; see JManager Result Codes.

DISCUSSION

The code verifier checks to see that the Java code is valid and that it does not attempt any illegal actions that could affect the host platform. You set the code verifier either when instantiating the session (using the JMOpenSession function JMOpenSession) or by calling the JMSetVerifyMode function JMSetVerifyMode.


JMSetVerifyMode

Sets the code verifier mode for an existing session.

OSStatus JMSetVerifyMode (JMSessionRef session,
                     JMVerifierOptions verifierOptions);
session
The session whose code verifier mode you wish to set.
verifierOptions
The code verifier option you want to set. See Session Security Indicators for a list of possible values.
function result
A result code; see JManager Result Codes.

DISCUSSION

The verifier checks to see that the Java code is valid and that it does not attempt any illegal actions that could affect the host platform. You can also set the verifier mode when calling the JMOpenSession function JMOpenSession.

SEE ALSO

The JMGetVerifyMode function .


JMGetSessionData

Obtains client data for an existing session.

OSStatus JMGetSessionData (
                     JMSessionRef session,
                     JMClientData* data);
session
The session whose client data you wish to obtain.
data
A pointer to client data. on return, this parameter contains the received client data.
function result
A result code; see JManager Result Codes.

SEE ALSO

The JMSetSessionData function.

JMSetSessionData

Sets client data for an existing session.

OSStatus JMSetSessionData (
                     JMSessionRef session,
                     JMClientData data);
session
The session whose client data you wish to change.
data
A pointer to the new client data.
function result
A result code; see JManager Result Codes.

SEE ALSO

The JMGetSessionData function
.

JMGetSessionProperty

Obtains a property value for an existing session.

OSStatus JMGetSessionProperty (
                     JMSessionRef session,
                     const JMTextRef propertyName,
                     JMTextRef* propertyValue;
session
The session whose property value you wish to obtain.
propertyName
A text object holding the name of the property whose value you want to obtain.
propertyValue
A pointer to the text object holding the property value. on return, this location contains the value of propertyName .
function result
A result code; see JManager Result Codes.

DISCUSSION

This function corresponds to the Java method java.lang.System.getProperty .

SEE ALSO

The JMPutSessionProperty function.


JMPutSessionProperty

Adds or modifies a session property.

OSStatus JMPutSessionProperty (
                     JMSessionRef session,
                     const JMTextRef propertyName,
                     const JMTextRef propertyValue);
session
The session whose property you wish to set.
propertyName
A text object holding the name of the property whose value you want to add or modify.
propertyValue
The value to set for propertyName , as a JMTextRef object.
function result
A result code; see JManager Result Codes.

DISCUSSION

If the property does not exist, JManager creates a new one with the name in propertyName and the value in propertyValue . This function corresponds to the Java method java.lang.System.setProperty .

SEE ALSO

The JMGetSessionProperty function.


JMGetSessionJNIObject

Obtains a JNI reference for an existing session

extern jobject JMGetSessionJNIObject (
                     JMSessionRef session,
                     JNIEnv * env);
session
The session whose object reference you wish to obtain.
env
The JNI environment whose session object reference you want to obtain.
function result
A pointer to the com.apple.mrj.JManager.JMSession object.

DESCRIPTION

The JMGetSessionJNIObject returns the JNI reference equivalent (of type jobject ) of the JMSessionRef reference.


JMGetSessionObject

Obtains a JRI reference for an existing session.

jref JMGetSessionObject (JMSessionRef session);
session
The session whose object reference you wish to obtain.
function result
A pointer to the com.apple.mrj.JManager.JMSession object.

DISCUSSION

The JMGetSessionObject returns the JRI reference equivalent (of type jref ) of the JMSessionRef reference.

Note that unless you specifically need to use the Java Runtime Interface (JRI), you should use the JMGetSessionJNIObject function instead.


© 1998 Apple Computer, Inc. — (Last Updated 3 Dec 98)